<?php
class friendControl extends skymvc{
	
	public function __construct(){
		parent::__construct();
	}
	
	public function onInit(){
		M("login")->checkLogin();
	}
	public function onDefault(){
		
	}
	
	public function onApply(){
		$userid=$_SESSION['ssuser']['userid'];
		$t_userid=get('t_userid','i');
		if(!M("friend")->selectRow("f_userid=".$userid." AND t_userid=".$t_userid."")){
			M("friend")->insert(array(
				"f_userid"=>$userid,
				"t_userid"=>$t_userid
			));
		}
		$this->goAll("申请成功");
	}
	
}

?>